<template>
  <el-table-column :label="dataHeader.title" :prop="dataHeader.title" align="center">
    <template v-for="item in dataHeader.childrens">
      <tableColumn v-if="item.childrens && item.childrens.length" :key="item.id" :data-header="item"></tableColumn>
      <el-table-column v-else :key="item.name" :label="item.title" :prop="item.field" align="center"></el-table-column>
    </template>
  </el-table-column>
</template>

<script>
export default {
  name: 'tableColumn',
  props: {
    dataHeader: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped>

</style>
